#ifndef WF_DIMLEADER_H
#define WF_DIMLEADER_H

#include "pf_previewactioninterface.h"
#include "gui_export.h"

class PF_Leader;

/**
 * This action class can handle user events to draw 
 * leaders (arrows).
 *
 */
class GUI_EXPORT WF_DimLeader : public PF_PreviewActionInterface {
	Q_OBJECT
public:
    /**
     * Action States.
     */
    enum Status {
        SetStartpoint,   /**< Setting the startpoint.  */
        SetEndpoint      /**< Setting the endpoint. */
    };

public:
    WF_DimLeader(PF_Container& container,
                      PF_GraphicView& graphicView);
    ~WF_DimLeader();
	
	static QAction* createGUIAction(LX_Define::ActionType /*type*/, QObject* /*parent*/);

	virtual LX_Define::ActionType rtti() {
		return LX_Define::ActionDimLeader;
	}

    void reset();

    virtual void init(int status=0);
    virtual void trigger();
	
    virtual void mouseMoveEvent(QMouseEvent* e);
    virtual void mouseReleaseEvent(QMouseEvent* e);
    virtual void keyPressEvent(QKeyEvent*);
	
	virtual void coordinateEvent(PF_CoordinateEvent* e);
    virtual void commandEvent(PF_CommandEvent* e);
        virtual QStringList getAvailableCommands();
	
	virtual void showOptions();
	virtual void hideOptions();
	
    virtual void updateMouseButtonHints();
    virtual void updateMouseCursor();
    virtual void updateToolBar();

protected:
    /**
     * Leader entity.
     */
    PF_Leader* leader;
	/**
	 * Points set so far.
	 */
        QList<PF_Vector> points;

};

#endif
